using System;
using System.Collections.Generic;
using System.Text;
using DTO;
using DAO;
using System.Data;

namespace BUS
{
	/// <summary> 
	///Author: nnamthach@gmail.com 
	/// <summary>
    public class ExpenseClaimControl
    {
		#region Local Variable
        private ExpenseClaimDataAccess _ExpenseClaimDAO;
		#endregion Local Variable
		
		#region Method
        public ExpenseClaimControl()
        {
            _ExpenseClaimDAO = new ExpenseClaimDataAccess();
        }
		
        public ExpenseClaimInfo Get_ExpenseClaim(
			String ExcNo,
			String EmployeeName
		, ref string sErr)
        {
            return _ExpenseClaimDAO.Get_ExpenseClaim(
			ExcNo,
			EmployeeName
			, ref sErr);
        }
		
        public DataTable GetAll_ExpenseClaim(ref string sErr)
        {
            return _ExpenseClaimDAO.GetAll_ExpenseClaim(ref sErr);
        }

        public DataTable GetCond(String strCond, ref string sErr)
        {
            return _ExpenseClaimDAO.GetCond(strCond, ref sErr);
        }
        public DataTable GetSumAmt(String strCond, ref string sErr)
        {
            return _ExpenseClaimDAO.GetSumAmt(strCond, ref sErr);
        }
        public DataTable GetSumOtherAmt(String strCond, ref string sErr)
        {
            return _ExpenseClaimDAO.GetSumOtherAmt(strCond, ref sErr);
        }
		
        public Int32 Add_ExpenseClaim(ExpenseClaimInfo obj, ref string sErr)
        {
            return _ExpenseClaimDAO.Add_ExpenseClaim(obj, ref sErr);
        }
		
        public string Update_ExpenseClaim(ExpenseClaimInfo obj)
        {
            return _ExpenseClaimDAO.Update_ExpenseClaim(obj);
        }

        public string Update_FieldExpenseClaim(String Reference, String FieldName, String Value)
        {
            return _ExpenseClaimDAO.Update_FieldExpenseClaim(Reference, FieldName, Value);
        }
		
        public string Delete_ExpenseClaim(
			String ExcNo,
			String EmployeeName
		)
        {
            return _ExpenseClaimDAO.Delete_ExpenseClaim(
			ExcNo,
			EmployeeName
			);
        }

        public string Delete_ExpenseClaimRef(
            int Reference
        )
        {
            return _ExpenseClaimDAO.Delete_ExpenseClaimRef(
            Reference
            );
        }  
        public Boolean IsExist_ExpenseClaim(
			String ExcNo,
			String EmployeeName,
            Int32 Reference
		)
        {
            return _ExpenseClaimDAO.IsExist_ExpenseClaim(
			ExcNo,
			EmployeeName,
            Reference
			);
        }

        public Boolean IsExist_ExpenseClaimRef(
            int Reference
        )
        {
            return _ExpenseClaimDAO.IsExist_ExpenseClaimRef(
            Reference
            );
        }
        public Boolean IsExist_ExpenseClaimOurRef(
            int Reference, String OurRef
        )
        {
            return _ExpenseClaimDAO.IsExist_ExpenseClaimOurRef(
            Reference, OurRef
            );
        } 
		
      /*  public string Delete_ExpenseClaim(String arrID)
        {
            string kq = "";
            string[] arrStrID = arrID.Split(',');
            foreach (string strID in arrStrID)
            {
                if (strID != "")
                {
                    int ID = Convert.ToInt32(strID);
                    kq += _ExpenseClaimDAO.Delete_ExpenseClaim(ID);
                }
            }
            return kq;
        } */
		
        public DataTable Search(String columnName, String columnValue, String condition, ref String sErr)
        {           
            return _ExpenseClaimDAO.Search(columnName, columnValue, condition, ref  sErr);
        }
        
		#endregion Method

    }
}
